#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import pymysql


def getTestConn():
    return pymysql.connect(host="172.16.1.65", port=3306, user='badperson', passwd="1q2w3e4r", db="test2",
                           charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)


def getHefuServerIdInstConn(ip, port, db, username, password):
    return pymysql.connect(host=ip, port=int(port), user=username, passwd=password, db=db, charset='utf8mb4',
                           cursorclass=pymysql.cursors.DictCursor)


def getMysqlServerMainCon(platform):
    if platform == 1:
        port = 10010
    else:
        port = 30001
    return pymysql.connect(host="localhost", port=port, user='badperson', passwd="1q2w3e4r", db="badPerson",
                           charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)
